package com.example.design.patterns.冰河.结构型模式.组合模式.composie;

import com.example.design.patterns.冰河.结构型模式.组合模式.component.Employer;
import java.util.ArrayList;

/**
 * Composite 定义有子部件的行为.存储子部件.
 * 在Component接口中实现与子部件相关的操作.
 */
public class ProjectManager extends Employer {
    public ProjectManager(String name) {
        this.setName(name);
        this.employers = new ArrayList<>();
    }

    /**
     *
     * @param employer
     */
    @Override
    public void add(Employer employer) {
        this.employers.add(employer);
    }

    /**
     *
     * @param employer
     */
    @Override
    public void delete(Employer employer) {
        this.employers.remove(employer);
    }
}
